package com.cseg674.dataentry.javaparser;
/*
 * RdfNestClass.java
 *
 * Created on February 28, 2008, 3:12 PM
 *
 */

/**
 *
 * @author Tian, Juan
 */
import java.util.LinkedList;

/**
 * RdfNestClass provides the attributes and methods that define a Nested Class in the RDF output.
 */
public class RdfNestClass extends RdfTreeNode{

    /**
	 * Contains the list of methods that are contained within the Nested Class
	 */
    private LinkedList <RdfMethod> methods;
    /**
	 * Contains the list of fields within the Nested Class
	 */
    private LinkedList <RdfField> fields;
    /**
	 * Contains the list of constructors of the Nested Class
	 */
    private LinkedList <RdfConstructor> contructors;
    /**
	 * Stores the superclass of this Nested Class
	 */
    private String superclass;
    /**
	 * Contains the list of interfaces implemented by the Nested Class
	 */
    private LinkedList <String> superInterfaces;

    /**
	 * Default Constructor: Creates a new instance of RdfNestClass
     */
    public RdfNestClass() {
        this("default");
    }

    /**
	 * Constructor: Creates a new instance of RdfNestClass
	 *
	 * @param perfix	the prefix of the RdfNestClass
     */
    public RdfNestClass(String perfix) {
        this(perfix, null, null);
    }

    /**
	 * Constructor: Creates a new instance of RdfNestClass
	 *
	 *  @param name	the name of the Nested Class
	 *  @param type	the type of the Nested Class
     */
    public RdfNestClass(String name, String type){
        this("default", name, type);
    }

    /**
	 * Constructor: Creates a new instance of RdfNestClass
	 *
	 * @param perfix	the prefix of the Nested Class
	 * @param name		the name of the Nested Class
	 * @param type		the type of the Nested Class
     */
    public RdfNestClass(String perfix, String name, String type) {
        this(perfix, name, type, null);
    }

    /**
	 * Constructor: Creates a new instance of RdfNestClass
	 *
	 * @param perfix	the prefix of the Nested Class
	 * @param name		the name of the Nested Class
	 * @param type		the type of the Nested Class
	 * @param superclass	the name of the superclass of the Nested Class
     */
    public RdfNestClass(String perfix, String name, String type, String superclass) {
        super(perfix, name, type);
        methods = new LinkedList <RdfMethod>();
        fields = new LinkedList <RdfField>();
        contructors = new LinkedList <RdfConstructor>();
        superInterfaces = new LinkedList <String>();
        this.superclass = superclass;
    }

	/**
	 * gets the list of methods that are contained in this Nested Class
	 *
	 * @return	list of methods contained within this Nested Class
     */
    public LinkedList<RdfMethod> getMethods() {
        return methods;
    }

	/**
	 * gets the list of fields that are contained in this Nested Class
	 *
	 * @return	list of fields contained within this Nested Class
     */
    public LinkedList<RdfField> getFields() {
        return fields;
    }

	/**
	 * gets the list of constructors that are contained in this Nested Class
	 *
	 * @return	list of constructors contained within this Nested Class
     */
    public LinkedList<RdfConstructor> getContructors() {
        return contructors;
    }

	/**
	 * gets the list of interfaces implemented by this Nested Class
	 *
	 * @return	list of interfaces implemented by this Nested Class
     */
    public LinkedList <String> getSuperInterfaces() {
        return superInterfaces;
    }

	/**
	 * sets the superclass of this Nested Class
	 *
	 * @param	the superclass of this Nested Class
	 */
    public void setSuperclass(String s) {
        superclass = s;
    }

	/**
	 * gets the superclass of this Nested Class
	 *
	 * @return	the superclass of this Nested Class
     */
    public String getSuperclass() {
        return superclass;
    }

	/**
	 * adds the interface implemented by this Nested Class
	 *
	 * @param s	the superclass of this Nested Class
	 * @return	<code>true</code> if the superclass was successfully added
     */
    public boolean addSuperInterface(String s) {
        return superInterfaces.add(s);
    }

	/**
	 * adds the method contained within this Nested Class
	 *
	 * @param a	the method of this Nested Class
	 * @return	<code>true</code> if the method was successfully added to the 'methods' list
     */
    public boolean addMethod(RdfMethod a) {
        return methods.add(a);
    }

	/**
	 * adds the field contained within this Nested Class
	 *
	 * @param a	the field of this Nested Class
	 * @return	<code>true</code> if the field was successfully added to the 'fields' list
     */    public boolean addField(RdfField a) {
        return fields.add(a);
    }

	/**
	 * adds the constructor of this Nested Class
	 *
	 * @param a	the constructor of this Nested Class
	 * @return	<code>true</code> if the constructor was successfully added to the 'constructors' list
     */    public boolean addContructor(RdfConstructor a) {
        return contructors.add(a);
    }



}
